# 课堂练习20240531 字典
# 钟奕升 2311020118
bianliang1=[]
bianliang2=()
bianliang3={}
print("bianliang1的类",type(bianliang1))
print("bianliang2的类",type(bianliang2))
print("bianliang3的类",type(bianliang3))
bianliang4={"姓名":"钟奕升","性别":"男","年龄":"19","身高":170}
print(bianliang4)
print(bianliang4["姓名"])
print(bianliang4["年龄"])
try:

    print(bianliang4["工资"])
except Exception as err:
    print(err)
print("修改字典:-----------------")
bianliang4['工资']=8888
bianliang4["年龄"]=60
print(bianliang4)
del bianliang4["身高"]
print(bianliang4)
print(bianliang4.keys())
print("值value: %s" % bianliang4.get("姓名"))
print(sorted([111, 2, 33], key=lambda x: len(str(x))))
print(list(range(1, 10, 3)))
a = ['name', 'age', 'sex']
b = ['Dong', 38, 'Male']
c=dict(zip(a,b))
print(type(c))
alist=[3, 4, 5, 6, 7, 9, 11, 13, 15, 17]
print("adfsadf",alist[3:7])
print([5]*10)
print([index for index, value in enumerate([3, 5, 7, 3, 7]) if value == max([3, 5, 7, 3, 7])])
print(list(range(6))[::2])
path = [1,2,3,4,5,6,7]
print(path[:-4])
print('!'.join(list('hello world')))
alist.sort()

